package com.itheima.tlias84.controller;

import com.itheima.tlias84.entity.Teacher;
import com.itheima.tlias84.utils.ResultUtil;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestBeanController {
//    @Resource
//    Teacher teacher;

//    @Resource
//    Teacher createTeacherOne;
    @Resource(name = "大白")
    Teacher teacher;

    @GetMapping("creatBean")
    public ResultUtil getTeacher() {
        //自动装载@Component
        //手动装载-->请转移到：Tlias84Application类
        return ResultUtil.success(teacher);
    }
}
